<template xmlns="http://www.w3.org/1999/html">

  <el-form v-model="userFromData" label-width="80px">
    <el-form-item label="账号:">
      <el-input placeholder="请输入账号" v-model="userFromData.account"/>
    </el-form-item>

    <el-form-item label="邮箱">
      <el-input placeholder="请输入邮箱" v-model="userFromData.email"/>
    </el-form-item>

    <el-form-item label="电话">
      <el-input placeholder="请输入电话" v-model="userFromData.mobile"/>
    </el-form-item>

    <el-form-item label="姓名">
      <el-input placeholder="请输入姓名" v-model="userFromData.name"/>
    </el-form-item>

    <el-form-item label="设置密码">
      <el-input placeholder="请输入密码" v-model="userFromData.password"/>
    </el-form-item>
    <el-button type="primary" @click="addUser">添加</el-button>
  </el-form>

</template>

<script>
import globalUser from '@/api/base/globalUser/index'
export default {
  name: 'add',
  data() {
    return {
      userFromData: {}
    }
  },methods:{
    addUser(){
      globalUser.addUser(this.userFromData).then(data =>{
        this.$message({
          type:'success',
          message:'添加成功!',
          showClose:true
        });
        this.$router.push({path:'/index'})
      })
    }
  }
}
</script>

<style scoped>

</style>
